import exporess from "express";
import * as userController from './user.controller'
import {authGuard} from '../auth/auth.middleware'
import {validateUserData,hashPassword,validateUpdataUserData} from './user.middleware'

const router=exporess.Router()

router.post('/users',validateUserData,hashPassword,userController.store)
router.post('/users/:userId',userController.show)
// authGuard 验证是否登录 401 未授权
router.patch('/users',authGuard,validateUpdataUserData,userController.update)


export default router